package cn.com.connext.scrm.repository.master;

import cn.com.connext.scrm.domain.master.CommentLikes;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface CommentLikesRepository extends JpaRepository<CommentLikes, String> {

    @Query(value = "select count(a) from CommentLikes a where a.commentId = :commentId")
    Integer countAllCommentLikes(@Param("commentId") String commentId);

    CommentLikes findOneByCommentIdAndUserId(String commentId, String userId);
}
